import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ExcludeMaterialVO, ExcludeMaterialForm, ExcludeMaterialQuery } from '@/api/datacheck/excludeMaterial/types';

/**
 * 查询聚水潭需要排除的物料列表
 * @param query
 * @returns {*}
 */

export const listExcludeMaterial = (query?: ExcludeMaterialQuery): AxiosPromise<ExcludeMaterialVO[]> => {
  return request({
    url: '/dataCheck/excludeMaterial/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询聚水潭需要排除的物料详细
 * @param id
 */
export const getExcludeMaterial = (id: string | number): AxiosPromise<ExcludeMaterialVO> => {
  return request({
    url: '/dataCheck/excludeMaterial/' + id,
    method: 'get'
  });
};

/**
 * 新增聚水潭需要排除的物料
 * @param data
 */
export const addExcludeMaterial = (data: ExcludeMaterialForm) => {
  return request({
    url: '/dataCheck/excludeMaterial',
    method: 'post',
    data: data
  });
};

/**
 * 修改聚水潭需要排除的物料
 * @param data
 */
export const updateExcludeMaterial = (data: ExcludeMaterialForm) => {
  return request({
    url: '/dataCheck/excludeMaterial',
    method: 'put',
    data: data
  });
};

/**
 * 删除聚水潭需要排除的物料
 * @param id
 */
export const delExcludeMaterial = (id: string | number | Array<string | number>) => {
  return request({
    url: '/dataCheck/excludeMaterial/' + id,
    method: 'delete'
  });
};
